#pragma once
#ifndef arrow_h__
#define arrow_h__
#include "../../../dxhead/dxegheader.h"
#include "../../../xlib/xlib.h"
#include "./xRes.h"
#include "./xPict.h"

namespace Sky
{
	class xDevice;
	class xDxInput;
	class xSprite;
	class xPict;
class xMouse:public xAppRes<xMouse*>
{
public:
	xMouse(TVoid);
	~xMouse(TVoid);

	TResult onCreate(xDxApp* app);
	TResult attachPict(xPict* pict);
	TResult Render(xSprite* sprite);
	TVoid   detachPict();
	TResult onDelete(xDxApp* app);
//////////////////////////////////////////////////////////////////////////
	TVoid SetRegion(TInt left,TInt top,TInt right,TInt bottom);
	TVoid Update(TInt dltx,TInt dlty);
	TVoid GetMousePos(TInt* x,TInt* y);
	
//////////////////////////////////////////////////////////////////////////
	TVoid SetRectSour(RECT& rect);
	TVoid SetVectorDest(D3DXVECTOR3 vPos);
	TVoid SetTransform(D3DXMATRIX& marTrans);
private:
	TVoid Initialise();
	TVoid Finalise();
	TVoid Release();
private:
	xPict* m_pArrow;
	xPict  m_myArrow;
	TBool m_bCreated;
	TBool m_bCreateCalled;

	D3DXMATRIX m_Trans;
	RECT  region;
	TInt                   m_iFrame;
	D3DXVECTOR3            m_vPos;
	RECT                   m_rSour;
	float                  m_fSpeed;
	DWORD                  m_dwFrame;
	DWORD                  m_dwPosition;
	DWORD                  m_dwPresentInterval;
};
}

#endif // arrow_h__